package com.bsnbase.sdk.entity.req.fabric;

import com.bsnbase.sdk.entity.base.IBody;
import lombok.Data;

/**
 * Request parameters of user certificate registration in Public Key Upload Mode interface
 */

@Data
public class ReqKeyEscrowEnroll implements IBody {
    /**
     * Username
     * Note: Registered username
     */
    String name;
    /**
     * User password
     * Note: Registered password
     */
    String secret;
    /**
     * Certificate application file
     * Note: The certificate application file generated by the algorithm of each framework, the certificate name is name@appCode
     */
    String csrPem;

    @Override
    public String getEncryptionValue() {
        return (this.name == null ? "" : this.name)
                + (this.secret == null ? "" : this.secret)
                + (this.csrPem == null ? "" : this.csrPem);
    }
}
